#ifndef DEXPANELCTLR_H
#define DEXPANELCTLR_H

#include <QApplication>
#include <QHash>

#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>

class DexPanel;

class DexPanelCtlr : public QApplication
	{
		public:
			DexPanelCtlr(int &, char **);
			DexPanelCtlr(Display*, int, char**, Qt::HANDLE, Qt::HANDLE);
			~DexPanelCtlr();

		protected:
			virtual Window getActiveClient();
			virtual void getActiveClients();
			virtual Atom getWindowType(Window);
			virtual void handleClientMessage(XClientMessageEvent*);
			virtual void handleDestroyNotify(XDestroyWindowEvent*);
			virtual void handleMapNotify(XMapEvent*);
			virtual void handlePropertyNotify(XPropertyEvent*);
			virtual void handleReparentNotify(XReparentEvent*);
			virtual void handleUnmapNotify(XUnmapEvent*);
			virtual bool x11EventFilter(XEvent*);

		private:
			QHash<int, DexPanel*> panels;
			Atom d_WM_CHANGE_STATE;
			Atom d_NET_WM_STATE;
			Atom d_NET_ACTIVE_WINDOW;
			Atom d_NET_CLOSE_WINDOW;
			Atom d_NET_CLIENT_LIST;
			Atom d_NET_WM_WINDOW_TYPE;
			Atom d_NET_WM_WINDOW_TYPE_DESKTOP;
			Atom d_NET_WM_WINDOW_TYPE_DOCK;
			Atom d_NET_WM_WINDOW_TYPE_NORMAL;
			Atom d_KDE_NET_WM_WINDOW_TYPE_OVERRIDE;

			void init();
	};

#endif // DEXPANELCTLR_H
